package com.lineage.server.serverpackets;

import com.lineage.server.templates.L1BookMark;
import java.util.List;

public class S_BookMarkList extends ServerBasePacket {
  private byte[] _byte;
  
  public S_BookMarkList(List<L1BookMark> bookmarks) {
    writeC(64);
    writeC(42);
    writeH(128);
    writeC(2);
    for (int i = 1; i < 128; i++)
      writeC(255); 
    writeH(80);
    writeH(bookmarks.size());
    for (L1BookMark book : bookmarks) {
      writeD(book.getId());
      writeS(book.getName());
      writeH(book.getMapId());
      writeH(book.getLocX());
      writeH(book.getLocY());
    } 
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
